package com.singulee.carschool.service.serviceImpl;

import com.singulee.carschool.mapper.CourseMapper;
import com.singulee.carschool.pojo.Course;
import com.singulee.carschool.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;

    public Map<String, Object> getCourse() {
        Map<String, Object> map = new HashMap<>();
        List<Course> courseList = courseMapper.getCourseList();
        map.put("code", 200);
        map.put("data", courseList);
        return map;
    }
}
